home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0885.dms / q0885.adf / Install-MRBackup < prev    next >
Text File  |  1997-04-10  |  7KB  |  296 lines

  1. ; Installer script for installing MRBackup Professional
  2.  
  3. (set @default_dest "SYS:MRBackup")
  4. (set @app-name "MRBackup Professional")
  5.  
  6. ; Establish an error cleanup routine.
  7.  
  8. (onerror
  9.     (makeassign "MRBackup" (safe))
  10. )
  11.  
  12. ; Get the version of the OS:
  13. ( set osVersion (getversion) )
  14. ( set osVer (/ osVersion 65536))
  15. ( set osRev (- osVersion (* osVer 65536) ) )
  16.  
  17. ( message ("You are currently running AmigaDOS %ld.%ld" osVer osRev ) )
  18.  
  19. ; See if this is really an update.
  20.  
  21. (set is_update 0)
  22. (set MRBackup_dest (getassign "MRBackup" "a"))
  23.  
  24. ; If it's an update, be sure user wants to use the same target directory.
  25.  
  26. (if MRBackup_dest
  27.     ; then
  28.     (if (askbool
  29.         (prompt "Your current copy of MRBackup Professional appears to be located in the drawer named \""
  30.                     MRBackup_dest
  31.                     "\". Do you want the update installed in that drawer?"
  32.             )
  33.             (help
  34. "The installer has determined that you may already have a "
  35. "copy of MRBackup installed on your system. If this is wrong or "
  36. "you want the update installed elsewhere, select NO as an "
  37. "answer. Otherwise, select YES."
  38.             )
  39.             (default 1)
  40.         )
  41.  
  42.         (set is_update 1)        ; if user wants in same place
  43.  
  44.         (set MRBackup_dest            ; if user wants in different place
  45.             (askdir
  46.                 (prompt "In which disk or drawer should MRBackup Professional be installed?")
  47.                 (help @askdir-help)
  48.                 (default "SYS:MRBackup")
  49.             )
  50.         )
  51.     )
  52.     ; else
  53.     (
  54.         (set MRBackup_dest
  55.             (askdir
  56.                 (prompt "In which disk or drawer should MRBackup Professional be installed?")
  57.                 (help @askdir-help)
  58.                 (default "SYS:MRBackup")
  59.             )
  60.         )
  61.     )
  62. )
  63.  
  64. (if (not (exists MRBackup_dest) )
  65.     (makedir MRBackup_dest (infos) (confirm) (help) 
  66.             (prompt "Creating destination directory...")
  67.     )
  68. )
  69.  
  70. (makeassign "MRBackup" MRBackup_dest (safe))
  71.  
  72. ; Now lock on to volume 'MRBackup'.
  73.  
  74. ;(askdisk
  75. ;    (prompt "Please insert the disk labeled \"MRBackup Professional\".")
  76. ;    (help    "The MRBackup Professional program and support files will be copied "
  77. ;            "from this disk onto your system.")
  78. ;    (dest  "MRBackup Professional")
  79. ;    (newname "MRBackupInstallDisk")
  80. ;)
  81.  
  82. ; Create a logical assignment to the current directory.
  83. (makeassign "MRBackupInstallDisk" "" (safe) )
  84.  
  85. ; Make MRBackup drawer & icon if not there
  86.  
  87. (if (not is_update)
  88.     (makedir MRBackup_dest (infos))
  89. )
  90.  
  91. (makedir (tackon MRBackup_dest "Work"))
  92. (makedir (tackon MRBackup_dest "Catalogs"))
  93. (makedir (tackon MRBackup_Dest "Lists_and_Logs"))
  94.  
  95. ; At this point we have a valid destination, so we tell installer where
  96. ; the application will end up so the exit page will be correct -- also,
  97. ; the installation log file (if any) will be copied to the destination
  98. (set @default-dest MRBackup_dest)
  99.  
  100. (set cpu_prompt (cat 
  101.     "If you have an accelerated Amiga with a 68020/68030/68040 CPU, you "
  102.     "can elect to install a special version of the software configured "
  103.     "for your accelerated CPU. DO NOT SELECT \"Accelerated CPU\" if you have "
  104.     "a stock 68000 CPU or your machine will crash when you attempt to run "
  105.     "the accelerated version of the software."
  106.     )
  107. )
  108.  
  109. (set cpu_type
  110.     (askchoice 
  111.         (prompt cpu_prompt) 
  112.         (choices "Stock CPU" "Accelerated CPU")
  113.         (help 
  114. "This prompt allows you to select a special version of the software "
  115. "which takes advantage of an accelerated CPU, should you have one "
  116. "installed in your Amiga."
  117.         )
  118.         (default 0) 
  119.     )
  120. )
  121.  
  122. (if (= cpu_type 0)
  123.     (set cpu_type "")
  124.     (set cpu_type "_020")
  125. )
  126.  
  127. ; Copy the user's registration key if it exists on the install disk.
  128. (if (exists "MRBackupInstallDisk:mrbackup.key")
  129.     (copyfiles
  130.         (source "MRBackupInstallDisk:mrbackup.key")
  131.         (dest MRBackup_dest)
  132.     )
  133. )
  134.  
  135. (copyfiles
  136.     (source "MRBackupInstallDisk:")
  137.     (pattern "#?.info")
  138.     (dest MRBackup_dest)
  139. )
  140.  
  141. (copyfiles
  142.     (source "MRBackupInstallDisk:Rexx")
  143.     (dest (tackon MRBackup_dest "Rexx") )
  144.     (all)
  145.     (infos)
  146. )
  147.  
  148.     ;
  149.     ; Delete previous .guide files. Older versions of MRBackup had many
  150.     ; files. This version has only one. 
  151.     ;
  152.  
  153. (
  154.     if is_update
  155.     ; then
  156.     (  
  157.         foreach (tackon MRBackup_dest "Help") 
  158.                 "#?.guide"
  159.                 ( delete @each-name )
  160.     )
  161. )
  162.  
  163. (copyfiles
  164.     (source "MRBackupInstallDisk:Help")
  165.     (dest (tackon MRBackup_dest "Help") )
  166.     (all)
  167.     (infos)
  168. )
  169.  
  170. (copyfiles
  171.     (source "MRBackupInstallDisk:Help.info")
  172.     (dest MRBackup_dest)
  173. )
  174.  
  175. ( if is_update 
  176.   (set copy_prefs 
  177.         (askbool (prompt "Overwrite preferences files?")
  178.                  (help "If you answer Yes, your existing preferences "
  179.                        "files will be overwritten. "
  180.                  )
  181.         )
  182.   )
  183.   ( set copy_prefs 1 )
  184. )
  185.   
  186.  
  187. ( if copy_prefs
  188.     ( copyfiles
  189.         (source "MRBackupInstallDisk:Prefs")
  190.         (dest (tackon MRBackup_dest "Prefs") )
  191.         (all)
  192.         (infos)
  193.     )
  194.     ( transcript "Preferences files were not copied." )
  195. )
  196.  
  197. (copyfiles
  198.     (source "MRBackupInstallDisk:Prefs.info")
  199.     (dest MRBackup_dest)
  200. )
  201.  
  202. (copyfiles
  203.     (source "MRBackupInstallDisk:Docs")
  204.     (dest (tackon MRBackup_dest "Docs") )
  205.     (all)
  206.     (infos)
  207. )
  208.  
  209. (copyfiles
  210.     (source "MRBackupInstallDisk:Docs.info")
  211.     (dest MRBackup_Dest)
  212. )
  213.  
  214. ; The shareware diskette has a special document at the top level.
  215.  
  216. (if (exists "MRBackupInstallDisk:ShareWare")
  217.     (copyfiles
  218.         (source "MRBackupInstallDisk:")
  219.         (pattern "(ShareWare|ShareWare.info)")
  220.         (dest MRBackup_dest)
  221.     )
  222. )
  223.  
  224. (copyfiles
  225.     (source "MRBackupInstallDisk:")
  226.     (pattern    "(MRBackup|MRBackup.info|Compressor.info|FormatDisk|FormatDisk.info)")
  227.     (dest MRBackup_dest)
  228. )
  229.  
  230. (set compressor_name (cat "Compressor" cpu_type))
  231. (copyfiles
  232.     (source (tackon "MRBackupInstallDisk:" compressor_name) )
  233.     (dest MRBackup_dest)
  234.     (newname (tackon MRBackup_dest "Compressor" ) )
  235. )
  236.  
  237. (working "Updating MRBackup icon...")
  238. (tooltype
  239.     (dest MRBackup_dest)
  240.     (noposition)
  241. )
  242.  
  243. ; Copy MRBackup's tape handler to the L: directory.
  244.  
  245. (working "Copying MRTape-Handler...")
  246. (copylib 
  247.     (source "MRBackupInstallDisk:L/mrtape-handler")
  248.     (dest "L:")
  249. )
  250.  
  251. (working "")
  252.  
  253. ; modify S:User-Startup
  254.  
  255. (startup "MRBackup"
  256.     (prompt
  257.         "Some instructions need to be added to the \"S:user-startup\" "
  258.         "so that your system will be properly configured to use MRBackup.")
  259.     (help "Do this or MRBackup won't work!!")
  260.     (command
  261.         "ASSIGN MRBackup: \"" MRBackup_dest "\"\n"
  262.         the_cache
  263.     )
  264. )
  265.  
  266. ; reinitialize assigns
  267.  
  268. (if (not @pretend)
  269.     (    
  270.         (makeassign "MRBackup" MRBackup_dest)
  271.     )
  272. )
  273.  
  274.  
  275.     ( copyfiles
  276.         ( source "MRBackupInstallDisk:Devs" )
  277.         ( dest (tackon MRBackup_dest "Devs" ) )
  278.         ( all )
  279.         ( infos )
  280.     )
  281.     ( message
  282.         "The MRTape mountlist entries have been placed in MRBackup:Devs."
  283.     )
  284. )
  285.  
  286. (complete 100)
  287.  
  288.     ; cleanup
  289.  
  290. (makeassign "MRBackupInstallDisk" (safe))
  291.  
  292. ; this is not strictly necessary, but doesn't hurt -- there is always
  293. ; a default (exit) at the end of any script
  294. (exit)
  295.